import {handleActions} from 'redux-actions';
import actionTypes from '../action-types/userInfo';

const initialState = {
  userInfo: {
    name: '123',
    gender: 'nan',
  },
};

const reducer = handleActions(
  {
    [actionTypes.SET_USER_INFO](state, {payload: data}) {
      const test = {
        name: '888',
        gender: 'girl',
      };
      return {
        ...state,
        userInfo: test,
      };
    },
  },
  initialState,
);

export default reducer;
